﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Lswweb.Model;
using Lswweb.Domain;

namespace Lswweb.Controls
{
    public class MessageList : SkinnedGridView<MessageInfo>
    {
        protected override IList<MessageInfo> GridViewDataSourceHandler(int pageIndex, int pageSize, out int totalRecord)
        {
            return Messages.GetModels(IsRead, pageSize, pageIndex, out totalRecord);
        }

        public bool IsRead
        {
            get { return Convert.ToBoolean(SiteContext.Current.Type); }
        }

        protected override string DefaultSkinFilename
        {
            get { return "Message/MessageList.ascx"; }
        }
    }
}
